Robot system, robot, robot control device, robot control method, and encoder

ABSTRACT

A robot system includes: a robot having a main shaft gear attached to a rotary shaft of a drive unit, a first countershaft gear meshing with the main shaft gear, a second countershaft gear meshing with the main shaft gear, and a third countershaft gear meshing with the main shaft gear; and a main shaft phase output unit outputting a phase of the main shaft gear as a first main shaft phase. A phase of the main shaft gear is derived as a second main shaft phase, based on a phase of the first countershaft gear, a phase of the second countershaft gear, and a phase of the third countershaft gear. Processing to stop the drive unit is performed when the first main shaft phase and the second main shaft phase do not coincide with each other.

The present application is based on, and claims priority from, JPApplication Serial Number 2018-204963, filed Oct. 31, 2018, thedisclosure of which is hereby incorporated by reference herein in itsentirety.

BACKGROUND 1. Technical Field

The present disclosure relates to a robot system, a robot, a robotcontrol device, a robot control method, and an encoder.

2. Related Art

Research and development of an encoder has been underway.

In this connection, an encoder which has a main shaft gear and threecountershaft gears, detects a phase of the main shaft gear and a phaseof each of the three countershaft gears, derives a number of rotationsof the main shaft gear, based on a combination of the detected phases ofthe three countershaft gears, and derives a multiple rotation quantityof the main shaft gear, based on the derived number of rotations and thedetected phase of the main shaft gear, is known. This encoder isdescribed in detail in JP-A-2013-104778. In this specification, thephase of a gear when the gear is rotated means the remainder of dividingthe angle of rotation of the gear by 360 degrees. Also, in thisspecification, the number of rotations of the gear when the gear isrotated means the quotient of dividing the angle of rotation of the gearby 360 degrees. Moreover, in this specification, the multiple rotationquantity of the gear means the angle of rotation of the gear. That is,in this specification, the multiple rotation quantity of the main shaftgear is the sum of the phase of the main shaft gear and the number ofrotations of the main shaft gear.

Such a related-art encoder, in some cases, erroneously detects a phasedifferent from the actual phase of the main shaft as the phase of themain shaft when an abnormality about the main shaft occurs. When a phasedifferent from the actual phase is erroneously derived as the phase ofthe main shaft, the encoder may derive a multiple rotation quantitydifferent from the actual multiple rotation quantity of the main shaftas the multiple rotation quantity of the main shaft. However, theencoder cannot determine whether a phase different from the actual phaseof the main shaft is detected or not.

SUMMARY

A robot system according to an aspect of the present disclosureincludes: a robot having a main shaft gear attached to a rotary shaft ofa drive unit, a first countershaft gear meshing with the main shaftgear, a second countershaft gear meshing with the main shaft gear, and athird countershaft gear meshing with the main shaft gear; and a mainshaft phase output unit outputting a phase of the main shaft gear as afirst main shaft phase. A phase of the main shaft gear is derived as asecond main shaft phase, based on a phase of the first countershaftgear, a phase of the second countershaft gear, and a phase of the thirdcountershaft gear. Processing to stop the drive unit is performed whenthe first main shaft phase and the second main shaft phase do notcoincide with each other.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows an example of the configuration of a robot system 1according to an embodiment.

FIG. 2 shows a configuration example of a plurality of gears provided inan encoder EC.

FIG. 3 shows an example of the hardware configuration of a robot controldevice 30.

FIG. 4 shows an example of the functional configuration of the robotcontrol device 30.

FIG. 5 shows an example of a flow of processing including both firstprocessing and third processing, of the processing performed by therobot control device 30.

FIG. 6 shows an example of a flow of processing of step S120 shown inFIG. 5.

FIG. 7 shows an example of first correspondence information.

FIG. 8 shows an example of a flow of processing of step S130 shown inFIG. 5.

FIG. 9 shows an example of fourth correspondence information.

FIG. 10 shows an example of a flow to derive a second main shaft phase.

FIG. 11 shows an example of a flow of processing of step S170 shown inFIG. 5.

FIG. 12 shows an example of the relationship between a main shaft gearG0, a first countershaft gear G1, Δθ1, and Δθ2.

FIG. 13 shows an example of the functional configuration of a controlunit 41.

FIG. 14 shows an example of the configuration of the robot system 1having a robot 21 instead of a robot 20.

DESCRIPTION OF EXEMPLARY EMBODIMENTS Embodiment

An embodiment of the present disclosure will now be described withreference to the drawings.

Outline of Robot System

First, an outline of a robot system according to the embodiment will bedescribed.

The robot system has an encoder, a robot having the encoder, and acontrol unit. The encoder has a main shaft gear attached to a rotaryshaft of a drive unit, a first countershaft gear meshing with the mainshaft gear, a second countershaft gear meshing with the main shaft gear,and a third countershaft gear meshing with the main shaft gear.

More specifically, the control unit performs first processing. The firstprocessing is processing including eleventh processing, twelfthprocessing, thirteenth processing, and fourteenth processing. Theeleventh processing refers to processing to derive a first number ofrotations based on the first countershaft gear and the secondcountershaft gear. The twelfth processing refers to processing to derivea second number of rotations based on the second countershaft gear andthe third countershaft gear. The thirteenth processing refers toprocessing to drive a third number of rotations based on the thirdcountershaft gear and the first countershaft gear. The fourteenthprocessing refers to processing to stop the drive unit when two or moreof the first number of rotations, the second number of rotations, andthe third number of rotations do not coincide with each other.

When two or more of the first number of rotations, the second number ofrotations, and the third number of rotations do not coincide with eachother, it is highly likely that an abnormality about the countershaftgear has occurred in the encoder. More specifically, in this case, it ishighly likely that an abnormality about a part or all of the first tothird countershaft gears has occurred in the encoder. When anabnormality about the countershaft gear has occurred in the encoder, themultiple rotation quantity of the main shaft gear derived based oninformation outputted from the encoder may be a value different from theactual multiple rotation quantity. This is because the multiple rotationquantity of the main shaft gear derived based on the information is thevalue of the phase of the main shaft gear added up with the number ofrotations of the main shaft gear, and the number of rotations of themain shaft gear is derived based on the phase of each of the first tothird countershaft gears. When the multiple rotation quantity of themain shaft gear derived based on the information is a value differentfrom the actual multiple rotation quantity, the robot may malfunction.

That is, the robot system determines whether the derived multiplerotation quantity of the main shaft gear is a value different from theactual multiple rotation quantity or not, based on the first processingperformed by the control unit. When the derived multiple rotationquantity of the main shaft gear is a value different from the actualmultiple rotation quantity, that is, when two or more of the firstnumber of rotations, the second number of rotations, and the thirdnumber of rotations do not coincide with each other, the robot systemstops the drive unit. Thus, the robot system can restrain the robot frommalfunctioning.

The robot system may also have a main shaft phase output unit. The mainshaft phase output unit outputs the phase of the main shaft gear as afirst main shaft phase. In this case, the control unit performs thirdprocessing. The third processing is processing including thirty-firstprocessing and thirty-second processing. The thirty-first processingrefers to processing to derive the phase of the main shaft gear as asecond main shaft phase, based on the phase of the first countershaftgear, the phase of the second countershaft gear, and the phase of thethird countershaft gear. The thirty-second processing refers toprocessing to stop the drive unit when the first main shaft phase andthe second main shaft phase do not coincide with each other.

When the first main shaft phase and the second main shaft phase do notcoincide with each other, it is highly likely that an abnormality aboutthe main shaft gear or the countershaft gear has occurred in theencoder. When an abnormality about the main shaft gear or thecountershaft gear has occurred in the encoder, the multiple rotationquantity of the main shaft gear derived based on information outputtedfrom the encoder may be a value different from the actual multiplerotation quantity. This is because the multiple rotation quantity of themain shaft gear derived based on the information is the value of thephase of the main shaft gear added up with the number of rotations ofthe main shaft gear, and the number of rotations of the main shaft gearis derived based on the phase of each of the first to third countershaftgears. When the multiple rotation quantity of the main shaft gearderived based on the information is a value different from the actualmultiple rotation quantity, malfunction may occur.

That is, the robot system determines whether the derived multiplerotation quantity of the main shaft gear is a value different from theactual multiple rotation quantity or not, based on the third processingperformed by the control unit. When the derived multiple rotationquantity of the main shaft gear is a value different from the actualmultiple rotation quantity, that is, when the first main shaft phase andthe second main shaft phase do not coincide with each other, the robotsystem stops the drive unit. Thus, the robot system can restrain therobot from malfunctioning.

Also, when the control unit performs both of the first processing andthe third processing, the robot system can determine which of the mainshaft gear and the countershaft gear has an abnormality in the encoder.

Hereinafter, the configuration of such a robot system and processingincluding the first processing and the third processing, of theprocessing performed by the control unit in the robot system, will bedescribed in detail. The control unit may be provided in the robot, maybe provided in a robot control device controlling the robot, may beprovided in an information processing device serving as a relay betweenthe robot and the robot control device, or may be provided in theencoder. As an example, the case where the control unit is provided inthe robot control device will be described below.

Configuration of Robot System

First, the configuration of a robot system 1 according to the embodimentwill be described with reference to FIG. 1.

FIG. 1 shows an example of the configuration of the robot system 1according to the embodiment. The robot system 1 is an example of theforegoing robot system.

The robot system 1 includes a robot 20, a robot control device 30, andan information processing device 40. In the robot system 1, a part orall of the robot 20, the robot control device 30, and the informationprocessing device 40 may be formed as separate units from each other ormay be formed as one unit. In the example shown in FIG. 1, all of therobot 20, the robot control device 30, and the information processingdevice 40 are formed as separate units from each other. The robot system1 may also be configured without having the information processingdevice 40.

The robot 20 is a SCARA robot. The SCARA robot is also referred to as ahorizontally articulated robot. The robot 20 may be a robot of anothertype such as a vertically articulated robot or linear motion robot,instead of the SCARA robot. The vertically articulated robot may be asingle-arm robot having one arm or may be a multi-arm robot having twoor more arms. A multi-arm robot having two arms is referred to as adual-arm robot. The robot 20 is an example of the foregoing robot.

The robot 20 has a base B and a moving section A.

The base B supports the moving section A. In the example shown in FIG.1, the base B is installed at a predetermined installation surface. Theinstallation surface is, for example, a floor surface of a room wherethe robot 20 carries out work. As the installation surface, anothersurface may be used, such as a wall surface of the room, a ceilingsurface of the room, a top surface of a table, a surface of a jig, or asurface of a stand, instead of the floor surface.

In the description below, for the sake of convenience of thedescription, a direction toward the installation surface from the baseB, of directions orthogonal to the installation surface, is referred toas downward or a downward direction. Also, in the description below, forthe sake of convenience of the description, a direction opposite to thedownward direction is referred to as upward or an upward direction.

The moving section A has a first arm A1 supported by the base B in sucha way as to be able to pivot around a first pivot axis AX1, a second armA2 supported by the first arm A1 in such a way as to be able to pivotaround a second pivot axis AX2, and a shaft S supported by the secondarm A2 in such a way as to be able to pivot around a third pivot axisAX3 and to translationally move in the axial direction of the thirdpivot axis AX3.

The shaft S is a cylindrical shaft member. A ball screw groove, notillustrated, and a spline groove, not illustrated, are provided on acircumferential surface of the shaft S. In the example shown in FIG. 1,the shaft S is provided, penetrating an end part opposite to the firstarm A1, of the end parts of the second arm A2, in up-down directions.

An external device can be attached to a distal end of the shaft S. Theexternal device that can be attached to the distal end of the shaft S isan end effector or the like. The distal end of the shaft S is the lowerend part, of the two ends parts of the shaft S. The distal end of theshaft S shown in FIG. 1 has nothing attached thereto. The end effectorattached to the distal end of the shaft S is, for example, an endeffector that can hold an object with a finger part. The end effectorattached to the distal end of the shaft S may also be an end effectorthat can hold an object by air suction, magnetic attraction or the like.The end effector attached to the distal end of the shaft S may also bean end effector that cannot hold an object. In this embodiment, holdingan object means turning an object into a state where the object can belifted up.

In this example, the first arm A1 pivots around the first pivot axis AX1and moves in a horizontal direction. In this embodiment, the horizontaldirection is a direction orthogonal to the up-down directions. Pivotingmeans a motion of rotating around an axis and includes the case wherethe angle of rotation is less than 360 degrees and the case where theangle of rotation is 360 degrees or greater. Also, the pivoting is notlimited to a motion of rotating in one direction and includes a motionof rotating in both directions.

The first arm A1 is driven to pivot around the first pivot axis AX1 by afirst drive unit M1 provided in the base B. The first drive unit M1 isan actuator causing the first arm A1 to pivot around the first pivotaxis AX1. The first drive unit M1 is, for example, a motor. That is, inthis embodiment, the first pivot axis AX1 is an imaginary axiscoincident with a rotary shaft of the first drive unit M1. As the firstdrive unit M1, another actuator causing the first arm A1 to pivot may beemployed, instead of the motor.

In this example, the second arm A2 pivots around the second pivot axisAX2 and moves in the horizontal direction.

The second arm A2 is driven to pivot around the second pivot axis AX2 bya second drive unit M2 provided in the second arm A2. The second driveunit M2 causes the second arm A2 to pivot around the second pivot axisAX2. The second drive unit M2 is, for example, a motor. That is, in thisembodiment, the second pivot axis AX2 is an imaginary axis coincidentwith a rotary shaft of the second drive unit M2. As the second driveunit M2, another actuator causing the second arm A2 to pivot may beemployed, instead of the motor.

The second arm A2 also has a third drive unit M3 and a fourth drive unitM4 and supports the shaft S.

The third drive unit M3 causes a ball screw nut provided at an outerperipheral part of the ball screw groove of the shaft S to pivot via atiming belt or the like. Thus, the third drive unit M3 causes the shaftS to move in the up-down direction. The third drive unit M3 is, forexample, a motor. As the third drive unit M3, another actuator causingthe shaft S to move in the up-down directions may be employed, insteadof the motor.

The fourth drive unit M4 causes a ball spline nut provided at an outerperipheral part of the spline groove of the shaft S to pivot via atiming belt or the like. Thus, the fourth drive unit M4 causes the shaftS to pivot around the third pivot axis AX3. The fourth drive unit M4 is,for example, a motor. As the fourth drive unit M4, another actuatorcausing the shaft S to pivot around the third pivot axis AX3 may beemployed, instead of the motor.

In this way, the third pivot axis AX3 is an imaginary axis coincidentwith the center axis of the shaft S.

Hereinafter, the case where all of the first to fourth drive units M1 toM4 have the same configuration will be described as an example. A partor all of the first to fourth drive units M1 to M4 may have differentconfigurations from each other. In the description below, the first tofourth drive units M1 to M4 are collectively referred to as a drive unitM unless it is necessary to distinguish these drive units from eachother.

The drive unit M has an encoder EC outputting a multiple rotationquantity of the rotary shaft of the drive unit M to another device. Thatis, in this embodiment, the drive unit M is a servo motor. In FIG. 1,the encoder EC is not illustrated in order not to complicate theillustration. The multiple rotation quantity of the rotary shaft refersto the multiple rotation quantity of a gear attached to the rotary shaftand rotating with the rotary shaft.

The encoder EC is a batteryless encoder. More specifically, the encoderEC has a plurality of gears and a sensor detecting a phase of each ofthe plurality of gears. Thus, a device which derives the multiplerotation quantity of the rotary shaft of the drive unit M can derive themultiple rotation quantity of the rotary shaft of the drive unit M,based on a combination of the phases of the plurality of gears. Thisdevice is, for example, the encoder EC, the robot control device 30, theinformation processing device and the like. That is, the encoder EC canhold the multiple rotation quantity of the rotary shaft without having abattery, even when electricity supply to the encoder EC is stopped. Theencoder EC is an example of the foregoing encoder. A configurationexample of the plurality of gears provided in the encoder EC will now bedescribed.

FIG. 2 shows a configuration example of the plurality of gears providedin the encoder EC. A rotary shaft ST shown in FIG. 2 is an example ofthe rotary shaft of the drive unit M. In FIG. 2, a cover of the encoderEC, a sensor provided in the encoder EC, a substrate for controlling thesensor, a wiring provided in the encoder EC, and the like, are notillustrated in order to clarify the configuration example of theplurality of gears provided in the encoder EC.

The encoder EC has four gears as the plurality of gears provided in theencoder EC, that is, a main shaft gear G0, a first countershaft gear G1,a second countershaft gear G2, and a third countershaft gear G3. Theencoder EC may have a configuration having one or more other gears inaddition to the four gears.

The main shaft gear G0 is attached to the rotary shaft ST, as shown inFIG. 2. In this case, the phase of the main shaft gear G0 coincides withthe phase of the rotary shaft ST. Also, in this case, the number ofrotations of the main shaft gear G0 coincides with the number ofrotations of the rotary shaft ST. Moreover, in this case, the multiplerotation quantity of the main shaft gear G0 coincides with the multiplerotation quantity of the rotary shaft ST. The main shaft gear G0 is anexample of the foregoing main shaft gear.

The first to third countershaft gears G1 to G3 are provided in theencoder EC in such a way that the teeth of the first to thirdcountershaft gears G1 to G3 respectively mesh with the teeth of the mainshaft gear G0. Also, the first to third countershaft gears G1 to G3 areprovided in the encoder EC in such a way that the teeth of the first tothird countershaft gears G1 to G3 do not mesh with each other. The firstcountershaft gear G1 is an example of the foregoing first countershaftgear. The second countershaft gear G2 is an example of the foregoingsecond countershaft gear. The third countershaft gear G3 is an exampleof the foregoing third countershaft gear.

In this way, the encoder EC has the main shaft gear G0, the firstcountershaft gear G1, the second countershaft gear G2, and the thirdcountershaft gear G3. Thus, the encoder EC can hold the multiplerotation quantity of the rotary shaft ST without having a battery, evenwhen electricity supply to the encoder EC is stopped, as described.

The combination of the number of teeth of the main shaft gear G0 and thenumber of teeth of each of the first to third countershaft gears G1 toG3 is, for example, a combination of four integers relatively prime toeach other. The combination of four integers relatively prime to eachother is, in other words, a combination of four integers having nogreatest common divisor other than 1. Hereinafter, the case where thenumber of teeth of the main shaft gear G0, the number of teeth of thefirst countershaft gear G1, the number of teeth of the secondcountershaft gear G2, and the number of teeth of the third countershaftgear G3 are 20, 17, 19, and 23 in order, will be described as anexample. That is, in this embodiment, the number of teeth of the mainshaft gear G0 is 20, the number of teeth of the first countershaft gearG1 is 17, the number of teeth of the second countershaft gear G2 is 19,and the number of teeth of the third countershaft gear G3 is 23. Thecombination of the number of teeth of the main shaft gear G0 and thenumber of teeth of each of the first to third countershaft gears G1 toG3 may be a combination of values resulting from multiplying fourintegers relatively prime to each other by a predetermined real number.However, in this case, the predetermined real number needs to be a realnumber decided in such a way that teeth can be formed on each of themain shaft gear G0, the first countershaft gear G1, the secondcountershaft gear G2, and the third countershaft gear G3. Therefore, itis desirable that the predetermined real number is an integer.

The combination of the number of teeth of the main shaft gear G0 and thenumber of teeth of each of the first to third countershaft gears G1 toG3 is also decided according to the number of rotations of the mainshaft gear G0 that should be held by the encoder EC. For example, withthe combination of the first countershaft gear G1 having the number ofteeth of 17 and the second countershaft gear G2 having the number ofteeth of 19, the number of rotations up to 17×19=323 can be held as thenumber of rotations of the main shaft gear G0.

The encoder EC also has a main shaft phase output unit S0, a first phaseoutput unit S1, a second phase output unit S2, and a third phase outputunit S3. In FIG. 2, the main shaft phase output unit S0, the first phaseoutput unit S1, the second phase output unit S2, and the third phaseoutput unit S3 are not illustrated in order to clarify the configurationexample of the four gears provided in the encoder EC.

The main shaft phase output unit S0 outputs the phase of the main shaftgear G0. The main shaft phase output unit S0 is, for example, a sensorwhich detects the phase of the main shaft gear G0 and outputs the phaseas a value representing a first main shaft phase. The sensor may be anoptical sensor, magnetic sensor, resolver, potentiometer, or anothersensor that can detect the phase. In the example shown in FIG. 2, theencoder EC has an optical sensor as the main shaft phase output unit S0.Therefore, at the distal end of the rotary shaft ST shown in FIG. 2, anoptical disk Dl provided with a plurality of slit arrays made up of aplurality of slits laid out in a circumferential direction is providedvia a pedestal B1. The main shaft phase output unit S0 is an example ofthe foregoing main shaft phase output unit.

The main shaft phase output unit S0 detects the phase of the main shaftgear G0 and outputs first main shaft phase information representing thedetected first main shaft phase to the robot control device 30 via theinformation processing device 40.

The first phase output unit S1 is a sensor which detects the phase ofthe first countershaft gear G1 and outputs the phase as a firstcountershaft phase. The sensor may be an optical sensor, magneticsensor, resolver, potentiometer, or another sensor that can detect thephase. In the description below, the case where the sensor is a magneticsensor is described as an example.

The first phase output unit S1 outputs first countershaft phaseinformation representing the detected first countershaft phase to therobot control device 30 via the information processing device 40.

The second phase output unit S2 is a sensor which detects the phase ofthe second countershaft gear G2 and outputs the phase as a secondcountershaft phase. The sensor may be an optical sensor, magneticsensor, resolver, potentiometer, or another sensor that can detect thephase. In the description below, the case where the sensor is a magneticsensor is described as an example.

The second phase output unit S2 outputs second countershaft phaseinformation representing the detected second countershaft phase to therobot control device 30 via the information processing device 40.

The third phase output unit S3 is a sensor which detects the phase ofthe third countershaft gear G3 and outputs the phase as a thirdcountershaft phase. The sensor may be an optical sensor, magneticsensor, resolver, potentiometer, or another sensor that can detect thephase. In the description below, the case where the sensor is a magneticsensor is described as an example.

The third phase output unit S3 outputs third countershaft phaseinformation representing the detected third countershaft phase to therobot control device 30 via the information processing device 40.

Back to FIG. 1, the robot control device 30 controls the robot 20. Inthe example shown in FIG. 1, the robot control device 30 controls therobot 20 via the information processing device 40.

The robot control device 30 acquires the first main shaft phaseinformation from the main shaft phase output unit S0 of the encoder EC.The robot control device 30 also acquires the first countershaft phaseinformation from the first phase output unit S1 of the encoder EC. Therobot control device 30 also acquires the second countershaft phaseinformation from the second phase output unit S2 of the encoder EC. Therobot control device 30 also acquires the third countershaft phaseinformation from the third phase output unit S3 of the encoder EC.

The robot control device 30 derives the multiple rotation quantity ofthe main shaft gear G0, based on the first main shaft phase information,the first countershaft phase information, the second countershaft phaseinformation, and the third countershaft phase information thus acquired.

More specifically, the robot control device 30 derives the number ofrotations of the main shaft gear G0, based on the combination of thefirst countershaft phase, the second countershaft phase, and the thirdcountershaft phase. The robot control device 30 then derives the valueof the derived number of rotations added up with the first main shaftphase, as the multiple rotation quantity of the main shaft gear G0. Therobot control device 30 specifies the derived multiple rotation quantityas the multiple rotation quantity of the rotary shaft of the drive unitM. The robot control device 30 controls the drive unit M, based on thespecified multiple rotation quantity, and thus causes the robot 20 tooperate. In this embodiment, the explanation of the processing in whichthe robot control device 30 causes the robot 20 to operate based on themultiple rotation quantity is omitted.

The robot control device 30 performs first processing. The firstprocessing is processing including eleventh processing, twelfthprocessing, thirteenth processing, and fourteenth processing. In theembodiment, the eleventh processing refers to processing to derive afirst number of rotations based on the first countershaft gear G1 andthe second countershaft gear G2. In the embodiment, the twelfthprocessing refers to processing to derive a second number of rotationsbased on the second countershaft gear G2 and the third countershaft gearG3. In the embodiment, the thirteenth processing refers to processing todrive a third number of rotations based on the third countershaft gearG3 and the first countershaft gear G1. In the embodiment, the fourteenthprocessing refers to processing to stop the drive unit M when two ormore of the first number of rotations, the second number of rotations,and the third number of rotations do not coincide with each other. Inthe embodiment, the first processing may also include another processingin addition to the eleventh processing, the twelfth processing, thethirteenth processing, and the fourteenth processing. In the embodiment,that two or more of three values do not coincide with each other meansthat two values included in a combination, of combinations of two valuesthat can be selected from among the three values, do not coincide witheach other, or that the three values do not coincide with each other. Asthe processing to stop the drive unit M, for example, when the robot 20has a power shutoff unit, processing to shut off the electricity supplyto the robot 20 may be performed to shut off the electricity supply tothe drive unit M, thus stopping the rotary motion of the drive unit M.Alternatively, for example, when the robot 20 is equipped with anelectromagnetic brake or the like, processing to turn on theelectromagnetic brake may be performed to stop the rotary motion of thedrive unit M.

When two or more of the first number of rotations, the second number ofrotations, and the third number of rotations do not coincide with eachother, it is highly likely that an abnormality about the countershaftgear has occurred in the encoder EC. More specifically, in this case, itis highly likely that an abnormality about a part or all of the first tothird countershaft gears G1 to G3 has occurred in the encoder EC. Theabnormality about the countershaft gear in the encoder EC is, forexample, wear of the teeth of a part or all of the first to thirdcountershaft gears G1 to G3, damage or loss of the teeth, failure of apart or all of the first to third phase output units S1 to S3, and thelike. When an abnormality about the countershaft gear has occurred inthe encoder EC, the multiple rotation quantity of the main shaft gearderived based on information outputted from the encoder EC may be avalue different from the actual multiple rotation quantity. This isbecause the multiple rotation quantity of the main shaft gear G0 derivedbased on the information is the value of the main shaft phase added upwith the number of rotations of the main shaft gear G0, and the numberof rotations of the main shaft gear G0 is derived based on the first tothird countershaft phases, as described above. When the multiplerotation quantity of the main shaft gear derived based on theinformation is a value different from the actual multiple rotationquantity, the robot 20 may malfunction.

That is, the robot control device 30 determines whether the number ofrotations of the main shaft gear G0 is a number of rotations differentfrom the actual number of rotations or not, by the first processing.This means that the robot control device 30 determines whether thederived multiple rotation quantity of the main shaft gear G0 is amultiple rotation quantity different from the actual multiple rotationquantity or not, by the first processing. When the derived multiplerotation quantity of the main shaft gear G0 is a value different fromthe actual multiple rotation quantity, that is, when two or more of thefirst number of rotations, the second number of rotations, and the thirdnumber of rotations do not coincide with each other, the robot controldevice 30 stops the drive unit M of the robot 20. Thus, the operation ofthe robot 20 can be stopped and the robot system 1 can restrain therobot 20 from malfunctioning.

The robot control device 30 also performs third processing. The thirdprocessing is processing including thirty-first processing andthirty-second processing. In the embodiment, the thirty-first processingrefers to processing to derive the phase of the main shaft gear G0 as asecond main shaft phase, based on the first countershaft phase, thesecond countershaft phase, and the third countershaft phase. In theembodiment, the thirty-second processing refers to processing to stopthe drive unit M when the first main shaft phase and the second mainshaft phase do not coincide with each other. In the embodiment, thethird processing may include another processing in addition to thethirty-first processing and the thirty-second processing.

When the first main shaft phase and the second main shaft phase do notcoincide with each other, it is highly likely that an abnormality aboutthe main shaft gear G0 or an abnormality about a part or all of thefirst to third countershaft gears G1 to G3 has occurred in the encoderEC. The abnormality about the main shaft gear G0 in the encoder EC is,for example, wear of the teeth of the main shaft gear G0, damage or lossof the teeth, failure of the main shaft phase output unit S0, and thelike. When such an abnormality has occurred in the encoder EC, themultiple rotation quantity of the main shaft gear G0 derived based oninformation outputted from the encoder EC may be a value different fromthe actual multiple rotation quantity. This is because the multiplerotation quantity of the main shaft gear derived based on theinformation is the value of the first main shaft phase added up with thenumber of rotations of the main shaft gear G0, and the number ofrotations of the main shaft gear G0 is derived based on the first tothird countershaft phases. When the multiple rotation quantity of themain shaft gear G0 derived based on the information is a value differentfrom the actual multiple rotation quantity, the accuracy of work carriedout by the robot 20 may drop due to malfunction, as described above.

That is, the robot control device 30 determines whether the derivedmultiple rotation quantity of the main shaft gear G0 is a valuedifferent from the actual multiple rotation quantity or not, by thethird processing. When the derived multiple rotation quantity of themain shaft gear G0 is a value different from the actual multiplerotation quantity, that is, when the first main shaft phase and thesecond main shaft phase do not coincide with each other, the robotcontrol device 30 stops the drive unit M. Thus, the operation of therobot 20 can be stopped and the robot system 1 can restrain the robot 20from malfunctioning.

The robot control device 30 may also be configured to perform processingincluding one of the first processing and the third processing describedabove, or may be configured to perform processing including both thefirst processing and the third processing. The case where the robotcontrol device 30 performs processing including both the firstprocessing and the third processing will now be described as an example.In this case, the robot control device 30 can determine which of themain shaft gear G0 and the countershaft gear has an abnormality in theencoder EC. The countershaft gear refers to a part or all of the firstto third countershaft gears G1 to G3. The robot control device 30 is anexample of the foregoing robot control device.

The information processing device 40 is an information processing deviceserving as a relay between the robot 20 and the robot control device 30.More specifically, the information processing device 40 relaystransmission of various signals between the robot 20 and the robotcontrol device 30. Thus, the information processing device 40 canperform processing according to various signals between the robot 20 andthe robot control device 30, independently of the robot control device30. Therefore, for example, when the robot 20 performs an unintendedoperation, the information processing device 40 can stop the robot 20more securely. That is, the information processing device 40 can improvethe safety of the robot system 1. In this embodiment, the informationprocessing device 40 will not be described further in detail. Theinformation processing device 40 is an example of the foregoinginformation processing device.

Hardware Configuration of Robot Control Device

The hardware configuration of the robot control device 30 will now bedescribed with reference to FIG. 3. FIG. 3 shows an example of thehardware configuration of the robot control device 30. The robot controldevice 30 has, for example, a processor 31, a memory 32, and acommunication unit 34. These components are coupled in such a way as tobe able to communicate with each other via a bus. The robot controldevice 30 also communicates with the robot 20 via the communication unit34. As described above, this communication is relayed by the informationprocessing device 40. The robot control device 30 may also have, forexample, a circuit for controlling a switch coupling each drive unit tothe power supply, that is, a motor driver, in addition to the abovecomponents.

The processor 31 is, for example, a CPU (central processing unit). Asthe processor 31, another processor such as an FPGA (field-programmablegate array) may be used. The processor 31 executes various commandsstored in the memory 32 provided in the robot control device 30.

The memory 32 includes, for example, an HDD (hard disk drive), SSD(solid-state drive), EEPROM (electrically erasable programmableread-only memory), ROM (read-only memory), RAM (random access memory) orthe like. The memory 32 may also be an external storage device coupledvia a USB (universal serial bus) or similar digital input/output port,instead of being built in the robot control device 30. The memory 32 mayalso be provided in a device other than the robot control device 30. Forexample, the memory 32 may be provided in the robot 20, the informationprocessing device 40, the encoder EC, a cloud computer or the like. Thememory 32 stores various kinds of information processed by the processor31, various commands executable by the computer, various images and thelike. The various commands are, for example, operation programs, codesand the like of the robot 20.

The communication unit 34 includes, for example, a USB or similardigital input/output port, an Ethernet (trademark registered) port, andthe like.

The robot control device 30 may also have an input device such as akeyboard, mouse, or touchpad. The robot control device 30 may also havea display device having a liquid crystal display panel, organic EL(electroluminescence) display panel or the like.

Functional Configuration of Robot Control Device

The functional configuration of the robot control device 30 will now bedescribed with reference to FIG. 4. FIG. 4 shows an example of thefunctional configuration of the robot control device 30. The robotcontrol device 30 has the memory 32, the communication unit 34, and acontrol unit 36. As described above, in the embodiment, the first tofourth drive units M1 to M4 have the same configuration. Therefore, inFIG. 4, in order to simplify the illustration, the main shaft phaseoutput unit S0, the first phase output unit S1, the second phase outputunit S2, and the third phase output unit S3 provided in each of thesecond to fourth drive units M2 to M4 are not illustrated. The controlunit 36 performs similar processing to each of the first to fourth driveunits M1 to M4. Therefore, hereinafter, the processing performed to eachof the first to fourth drive units M1 to M4 by the control unit 36 willbe described, using the processing performed to the first drive unit M1by the control unit 36 as an example.

The control unit 36 controls the entirety of the robot control device30. The control unit 36 has an acquisition unit 361, a derivation unit363, a determination unit 365, a time measuring unit 367, a robotcontrol unit 369, and a reporting unit 371. These functional unitsprovided in the control unit 36 are implemented, for example, by theprocessor 31 executing various commands stored in the memory 32. A partor all of these functional units may be a hardware functional unit suchas an LSI (large-scale integrated) circuit or ASIC (application-specificintegrated circuit).

The acquisition unit 361 acquires first main shaft phase informationfrom the main shaft phase output unit S0 of the first drive unit M1. Theacquisition unit 361 also acquires first countershaft phase informationfrom the first phase output unit S1 of the first drive unit M1. Theacquisition unit 361 also acquires second countershaft phase informationfrom the second phase output unit S2 of the first drive unit M1. Theacquisition unit 361 also acquires third countershaft phase informationfrom the third phase output unit S3 of the first drive unit M1.

The derivation unit 363 performs various kinds of derivation processingperformed by the robot control device 30.

For example, based on three phases represented by information acquiredby the acquisition unit 361 from the encoder EC of the first drive unitM1, the derivation unit 363 derives the number of rotations of the mainshaft gear G0 provided in the encoder EC. This information is the firstcountershaft phase information, the second countershaft phaseinformation, and the third countershaft phase information. The threephases are the first countershaft phase, the second countershaft phase,and the third countershaft phase. The derivation unit 363 derives thevalue of the derived number of rotations of the main shaft gear G0 addedup with the first main shaft phase represented by the first main shaftphase information acquired from the encoder EC by the acquisition unit361, as the multiple rotation quantity of the main shaft gear G0.

The acquisition unit 361 also derives each of a first number ofrotations, a second number of rotations, and a third number of rotationsfor the encoder EC of the first drive unit M1. The first number ofrotations of the encoder EC is the number of rotations of the main shaftgear G0 of the encoder EC derived based on the first countershaft phaseof the encoder EC and the second countershaft phase of the encoder EC.The second number of rotations of the encoder EC is the number ofrotations of the main shaft gear G0 of the encoder EC derived based onthe second countershaft phase of the encoder EC and the thirdcountershaft phase of the encoder EC. The third number of rotations ofthe encoder EC is the number of rotations of the main shaft gear G0 ofthe encoder EC derived based on the third countershaft phase of theencoder EC and the first countershaft phase of the encoder EC.

The derivation unit 363 also derives the phase of the main shaft gear G0as a second main shaft phase, based on the first countershaft phase, thesecond countershaft phase, and the third countershaft phase, for theencoder EC of the first drive unit M1.

The determination unit 365 performs various kinds of determinationprocessing performed by the robot control device 30.

The determination unit 365 determines whether a first abnormalitycondition is satisfied or not, for example, based on each of the firstnumber of rotations, the second number of rotations, and the thirdnumber of rotations derived by the derivation unit 363 for the firstdrive unit M1. The first abnormality condition is that two or more ofthe first number of rotations, the second number of rotations, and thethird number of rotations do not coincide with each other. The firstabnormality condition may include another condition in addition to this.Also, the first abnormality condition may be that two of the firstnumber of rotations, the second number of rotations, and the thirdnumber of rotations do not coincide with each other. That is, the firstabnormality condition may be that the two of the first number ofrotations and the second number of rotations do not coincide with eachother, that the two of the second number of rotations and the thirdnumber of rotations do not coincide with each other, or that the two ofthe third number of rotations and the first number of rotations do notcoincide with each other. The first abnormality condition may also be acombination of two of these three conditions.

The determination unit 365 also determines whether a third abnormalitycondition is satisfied or not, for example, based on the informationrepresenting the first main shaft phase acquired by the acquisition unit361 and the second main shaft phase derived by the derivation unit 363.The third abnormality condition is that the first main shaft phase andthe second main shaft phase do not coincide with each other. The thirdabnormality condition may include another condition in addition to this.

The time measuring unit 367 measures the elapsed time.

The robot control unit 369 controls the robot 20.

The robot control unit 369 causes the robot 20 to carry outpredetermined work, for example, based on an operation program stored inadvance in the memory 32.

The robot control unit 369 stops the drive unit M, for example, when thedetermination unit 365 determines that the first abnormality conditionis satisfied.

The robot control unit 369 stops the drive unit M, for example, when thedetermination unit 365 determines that the third abnormality conditionis satisfied.

The reporting unit 371 reports information representing that the firstabnormality condition is satisfied, when the determination unit 365determines that the first abnormality condition is satisfied. Thereporting unit 371 reports information representing that the thirdabnormality condition is satisfied, when the determination unit 365determines that the third abnormality condition is satisfied.

For example, when reporting certain information, the reporting unit 371emits a sound representing the information from a speaker and thusreports the information. In this case, the reporting unit 371 may beconfigured to emit the sound from a speaker provided in the robotcontrol device 30 so as to report the information, or may be configuredto emit the sound from a speaker provided in another device coupled insuch a way as to be able to communicate with the robot control device 30so as to report the information. When reporting the information, thereporting unit 371 also turns on a lamp that emits light representingthe information, and thus reports the information. The lamp is, forexample, a rotating warning lamp. In this case, the reporting unit 371may be configured to turn on the lamp provided in the robot controldevice 30 so as to report the information, or may be configured to turnon a lamp provided in another device coupled in such a way as to be ableto communicate with the robot control device 30 so as to report theinformation. The reporting unit 371 also displays, for example, an imagerepresenting the information on a display and thus reports theinformation. In this case, the reporting unit 371 may be configured todisplay the image on a display provided in the robot control device 30so as to report the information, or may be configured to display theimage on a display provided in another device coupled in such a way asto be able to communication with the robot control device 30 so as toreport the information. The reporting unit 371 also outputs theinformation to another device and thus reports the information. Thereporting unit 371 may also be configured to report the information by amethod other than these.

Processing Including Both First Processing and Third Processing

The processing including both the first processing and the thirdprocessing, of the processing performed by the robot control device 30,will now be described. FIG. 5 shows an example of the flow of theprocessing including both the first processing and the third processing,of the processing performed by the robot control device 30. In theexample shown in FIG. 5, this processing includes second processing inaddition to the first processing and the third processing.

The second processing is processing to determine whether, as the amountof change in the phase of each of the three countershaft gears providedin the encoder EC of the drive unit M, an amount of change differentfrom the actual amount of change is derived or not. Details of thesecond processing will be described later. The processing including boththe first processing and the third processing, of the processingperformed by the robot control device 30, may include another processinginstead of the second processing or may include another processing inaddition to the second processing.

The robot control unit 369 waits until a predetermined start conditionis satisfied at a timing before the robot control unit 369 causes therobot 20 to start operating (step S110).

The timing before the robot control unit 369 causes the robot 20 tostart operating is, in other words, a timing before the robot controldevice 30 accepts an operation to execute an operation program causingthe robot 20 to operate. The timing before the robot control unit 369causes the robot 20 to start operating is also a timing before the robot20 starts operating. That is, in the embodiment, a period when the robot20 is operating is a period when the operation program is beingexecuted. Moreover, the timing when the robot control unit 369 causesthe robot 20 to start operating may be a timing when a current flowsthrough the drive unit M in order to drive the drive unit M. Forexample, in the case of a three-phase AC system, this timing may be atiming when a current flows through each phase. Also, when anelectromagnetic brake or the like is installed, this timing may be atiming when a voltage or current with which the electromagnetic braketurns off is provided.

The start condition is, for example, that the power supply of the robot20 is turned on. For example, the start condition is that a currentflows through a switch that can physically couple or cut off thesubstrate of the robot control device 30 and the power supply, to orfrom the robot control device 30, or that the voltage across the switchbecomes equal to the power-supply voltage. Instead of this, the startcondition may be that electric power is supplied to the substrate of apart or all of the robot 20, the information processing device 40, andthe encoder EC. For example, the start condition may be that, throughthe substrate of a part of these, a higher current value flows than whenthe substrate is in standby state. The start condition may also be thatthe robot control device 30 accepts an operation that causes the robotcontrol device 30 to start the processing in the flowchart shown in FIG.5. As the start condition, another condition may be employed.

When robot control unit 369 determines that the start condition issatisfied at the timing before the robot control unit 369 causes therobot 20 to start operating (YES in step S110), the control unit 36performs the first processing (step S120). The flow of the firstprocessing and the agent performing each processing included in thefirst processing will be described later.

Next, the control unit 36 performs the third processing (step S130). Theflow of the third processing and the agent performing each processingincluded in the third processing will be described later.

The control unit 36 may be configured to perform the processing of stepS120 and the processing of step S130 in parallel or may be configured toperform the processing of step S120 and the processing of step S130 inthe reverse order of the order shown in FIG. 5.

Next, the robot control unit 369 waits until starting the operation ofthe robot 20 (step S140). For example, when the robot control unit 369accepts an operation to execute an operation program that causes therobot 20 to operate, the robot control unit 369 determines that theoperation of the robot 20 is to be started. At this time, a currentflows through the drive unit M.

The time measuring unit 367 starts measuring time, when the robotcontrol unit 369 determines that the operation of the robot 20 is to bestarted (YES in step S140). The time measuring unit 367 determineswhether or not a first predetermined time has passed since theimmediately previous timing of starting time measurement (step S150).The first predetermined time is, for example, one minute. The firstpredetermined time may be shorter than one minute or longer than oneminute. The first predetermined time is an example of the predeterminedtime.

When the time measuring unit 367 determines that the first predeterminedtime has not passed since the immediately previous timing of startingtime measurement (NO in step S150), the time measuring unit 367determines whether a second predetermined time has passed since thetiming or not (step S160). The second predetermined time is, forexample, 0.001 seconds. The second predetermined time may be shorterthan 0.001 seconds or longer than 0.001 seconds.

When the time measuring unit 367 determines that the secondpredetermined time has not passed since the immediately previous timingof starting time measurement (NO in step S160), the time measuring unit367 shifts to step S150 and determines again whether the firstpredetermined time has passed since the timing or not.

Meanwhile, when the time measuring unit 367 determines that the secondpredetermined time has passed since the immediately previous timing ofstarting time measurement (YES in step S160), the control unit 36performs the second processing (step S170). The flow of the secondprocessing and the agent performing each processing included in thesecond processing will be described later.

After the processing of step S170, the time measuring unit 367 shifts tostep S150 and determines again whether or not the first predeterminedtime has passed since the immediately previous timing of starting timemeasurement.

Meanwhile, when the time measuring unit 367 determines that the firstpredetermined time has passed since the immediately previous timing ofstarting time measurement (YES in step S150), the time measuring unit367 ends the time measurement started immediately before. The controlunit 36 then performs the first processing (step S180). The processingof step S180 is similar to the processing of step S120 and thereforewill not be described further.

Next, the control unit 36 performs the third processing (step S190). Theprocessing of step S190 is similar to the processing of step S130 andtherefore will not be described further.

The control unit 36 may be configured to perform the processing of stepS180 and the processing of step S190 in parallel or may be configured toperform the processing of step S180 and the processing of step S190 inthe reverse order of the order shown in FIG. 5.

After the processing of step S190, the time measuring unit 367 shifts tostep S150 and starts measuring time again. The time measuring unit 367then determines whether or not the first predetermined time has passedsince the immediately previous timing of starting time measurement.

As described above, in the example shown in FIG. 5, the robot controldevice 30 performs the first processing and the third processing duringthe period until the robot 20 starts moving after the power supply ofthe robot 20 is turned on. The robot control device 30 may be configuredto perform the first processing and the third processing at anothertiming or during another period. When the robot control device 30 doesnot perform the first processing, steps S120 and S180 are omitted. Whenthe robot control device 30 does not perform the third processing, stepsS130 and S190 are omitted.

In the example shown in FIG. 5, after performing the first round of thefirst processing, the robot control device 30 performs the firstprocessing every time the first predetermined time passes. Therefore,even when the derived multiple rotation quantity of the main shaft gearG0 is a value different from the actual multiple rotation quantityduring the operation of the robot 20, the robot control device 30 canstop the robot 20 by stopping the drive unit M. Thus, the robot controldevice 30 can more securely restrain the robot 20 from malfunctioning.That the first predetermined time passes is an example of thepredetermined condition. The robot control device 30 may be configuredto perform the processing of step S180 when a condition different fromthat the first predetermined time passes is satisfied in step S150, andto perform the processing of step S160 when this condition is notsatisfied. The condition is, for example, that the number of times therobot 20 performs work reaches a predetermined number of times, or thelike.

Of the processing in the flowchart shown in FIG. 5, the processing ofstep S150, the processing of step S180, and the processing of step S190may be omitted. Thus, the robot control device 30 can reduce the load ofthe processing performed by the robot control device 30 during theoperation of the robot 20. However, in the case where the robot controldevice 30 does not omit but executes the processing of step S180 and theprocessing of step S190, the robot control device 30 can restrain therobot 20 from malfunctioning even when an abnormality about the mainshaft gear G0 or the countershaft gear occurs in the encoder EC duringthe operation of the robot 20.

In the example shown in FIG. 5, the robot control device 30 may beconfigured to perform the processing of step S170 when a conditiondifferent from that the second predetermines time passes is satisfied instep S160, and to perform the processing of step S150 when thiscondition is not satisfied. The condition is, for example, that thenumber of times the robot 20 performs work reaches a predeterminednumber of times, or the like.

The processing of a part or all of the processing in the flowchart shownin FIG. 5 may be performed by a part or all of the robot 20, theinformation processing device 40, and the encoder EC, instead of therobot control device 30, or may be performed by a part or all of therobot 20, the information processing device 40, and the encoder EC, inaddition to the robot control device 30. In this case, the deviceperforming the processing of a part or all of the processing in theflowchart shown in FIG. 5 has the function of performing thisprocessing, of the functions of the control unit 36. In the robot system1, this device is the robot 20, the information processing device 40,the encoder EC, or the like. However, another device may be employedinstead of these. In this case, the robot system 1 has this anotherdevice.

Processing of Step S120

The processing of step S120 shown in FIG. 5, that is, the firstprocessing, will now be described. FIG. 6 shows an example of the flowof the processing of step S120 shown in FIG. 5. The processing in theflowchart shown in FIG. 6 is performed for each of the four drive unitsM. Therefore, the processing of step S120 will be described, using theprocessing for the first drive unit M1 as an example.

The acquisition unit 361 acquires first main shaft phase informationfrom the main shaft phase output unit S0 of the encoder EC provided inthe first drive unit M1 (step S210).

Next, the acquisition unit 361 acquires first countershaft phaseinformation from the first phase output unit S1 of the encoder ECprovided in the first drive unit M1, acquires second countershaft phaseinformation from the second phase output unit S2 of the encoder EC, andacquires third countershaft phase information from the third phaseoutput unit S3 of the encoder EC (step S220).

Next, the derivation unit 363 derives the number of rotations of themain shaft gear G0, based on the three pieces of countershaft phaseinformation acquired in step S220 (step S230). The three pieces ofcountershaft phase information are the first countershaft phaseinformation, the second countershaft phase information, and the thirdcountershaft phase information.

The processing of step S230 will now be described.

First, an example of the method by which the derivation unit 363 derivesthe number of rotations of the main shaft gear G0, based on the firstcountershaft phase information, the second countershaft phaseinformation, and the third countershaft phase information, will bedescribed.

When each of two gears meshes with one other gear, the combination ofthe phases of the two gears can correspond one-to-one to the number ofrotations of the one gear. Therefore, the combination of the firstcountershaft phase and the second countershaft phase can correspond tothe number of rotations of the main shaft gear G0. The combination ofthe second countershaft phase and the third countershaft phase cancorrespond to the number of rotations of the main shaft gear G0. Thecombination of the third countershaft phase and the first countershaftphase can correspond to the number of rotations of the main shaft gearG0. Therefore, the derivation unit 363 can derive the number ofrotations of the main shaft gear G0, based on the combination of thefirst countershaft phase and the second countershaft phase. Thederivation unit 363 can also derive the number of rotations of the mainshaft gear G0, based on the combination of the second countershaft phaseand the third countershaft phase. The derivation unit 363 can derive thenumber of rotations of the main shaft gear G0, based on the combinationof the third countershaft phase and the first countershaft phase.

Thus, the derivation unit 363 derives the number of rotations of themain shaft gear G0 as the first number of rotations, based on the firstcountershaft phase, the second countershaft phase, and firstcorrespondence information stored in advance in the memory 32. The firstcorrespondence information is information of the correspondence betweenthe combination of the first countershaft phase and the secondcountershaft phase, and the number of rotations of the main shaft gearG0. However, in order to derive the first number of rotations as aninteger, the derivation unit 363, for example, discards the numbersbelow the decimal point of the number of rotations of the main shaftgear G0 corresponding to the combination of the first countershaft phaseand the second countershaft phase in the first correspondenceinformation. For the handling of the numbers below the decimal point ofthe number of rotations in the first correspondence information, anothermethod such as rounding off to the nearest integer may be employed.

FIG. 7 shows an example of the first correspondence information. In theexample shown in FIG. 7, the first correspondence information is a tableshowing the correspondence between the combination of the firstcountershaft phase and the second countershaft phase, and the number ofrotations of the main shaft gear G0. This table also shows thecorrespondence between information representing the number of rotationsof the main shaft gear G0, information representing the amount of changein the phase of the main shaft gear G0 corresponding to the number ofrotations, information representing the phase difference between themain shaft gear G0 and the first countershaft gear G1, and informationrepresenting the phase difference between the main shaft gear G0 and thesecond countershaft gear G2. The phase difference between the main shaftgear G0 and the first countershaft gear G1 can be used instead of thefirst countershaft phase. Therefore, the table includes the informationrepresenting the phase difference between the main shaft gear G0 and thefirst countershaft gear G1, instead of information representing thefirst countershaft phase. The phase difference between the main shaftgear G0 and the second countershaft gear G2 can be used instead of thesecond countershaft phase. Therefore, the table includes the informationrepresenting the phase difference between the main shaft gear G0 and thesecond countershaft gear G2, instead of information representing thesecond countershaft phase.

In the table shown in FIG. 7, the information representing the amount ofchange in the phase of the main shaft gear G0 is expressed by the numberof teeth by which the main shaft gear G0 has moved from the startingpoint according to the number of rotations of the main shaft gear G0.For example, in the embodiment, the number of teeth of the main shaftgear G0 is 20. Therefore, the table shows that the amount of change inthe phase of the main shaft gear G0 when the number of rotations of themain shaft gear G0 is one is “20 teeth”.

In the table shown in FIG. 7, the information representing the phasedifference between the main shaft gear G0 and the first countershaftgear G1 is expressed by the number of teeth of the first countershaftgear G1. For example, in the embodiment, the number of teeth of the mainshaft gear G0 is 20 and the number of teeth of the first countershaftgear G1 is 17. Therefore, when the number of rotations of the main shaftgear G0 is one, the phase of the first countershaft gear G1 is greaterthan the phase of the main shaft gear G0 by three teeth of the firstcountershaft gear G1. That is, the first countershaft gear G1 rotatesmore than the main shaft gear G0 by three teeth of the firstcountershaft gear G1. In other words, the phase difference between themain shaft gear G0 and the first countershaft gear G1 is +3 teeth of thefirst countershaft gear G1. Thus, the table shows that the informationrepresenting this phase difference is “+3 teeth”.

In the table shown in FIG. 7, the information representing the phasedifference between the main shaft gear G0 and the second countershaftgear G2 is expressed by the number of teeth of the second countershaftgear G2. For example, in the embodiment, the number of teeth of the mainshaft gear G0 is 20 and the number of teeth of the second countershaftgear G2 is 19. Therefore, when the number of rotations of the main shaftgear G0 is one, the phase of the second countershaft gear G2 is greaterthan the phase of the main shaft gear G0 by one tooth of the secondcountershaft gear G2. That is, the second countershaft gear G2 rotatesmore than the main shaft gear G0 by one tooth of the second countershaftgear G2. In other words, the phase difference between the main shaftgear G0 and the second countershaft gear G2 is +1 tooth of the secondcountershaft gear G2. Thus, the table shows that the informationrepresenting this phase difference is “+1 tooth”.

The table shown in FIG. 7 shows only the cases where the amount ofchange in the phase of the main shaft gear G0 is 20 teeth and 40 teeth.However, the table is simply an example given to simplify thedescription. The amount of change may be an integer or a real number.The amount of change in the phase of the main shaft gear G0 may also beexpressed by other information representing the amount of change,instead of the number of teeth of the main shaft gear G0. The table mayalso show other information representing the phase difference betweenthe main shaft gear G0 and the first countershaft gear G1, instead ofthe phase difference expressed by the number of teeth of the firstcountershaft gear G1. The table may also show other informationrepresenting the phase difference between the main shaft gear G0 and thesecond countershaft gear G2, instead of the phase difference expressedby the number of teeth of the second countershaft gear G2. As the firstcorrespondence information, other information representing thecorrespondence between the combination of the first countershaft phaseand the second countershaft phase, and the number of rotations of themain shaft gear G0, may be employed, instead of the table.

The derivation unit 363 derives the number of rotations of the mainshaft gear G0 as the first number of rotations, using such firstcorrespondence information. Specifically, the derivation unit 363detects the number of rotations of the main shaft gear G0 correspondingto the combination of the first countershaft phase and the secondcountershaft phase from the first correspondence information stored inadvance in the memory 32 and thus derives this number of rotations asthe first number of rotations.

The derivation unit 363 also derives the number of rotations of the mainshaft gear G0 as the second number of rotations, based on the secondcountershaft phase, the third countershaft phase, and secondcorrespondence information stored in advance in the memory 32. Thesecond correspondence information is information of the correspondencebetween the combination of the second countershaft phase and the thirdcountershaft phase, and the number of rotations of the main shaft gearG0. The configuration of the second correspondence information issimilar to the configuration of the first correspondence information andtherefore will not be described further. That is, in the embodiment, thesecond correspondence information is a table showing the correspondencebetween information representing the number of rotations of the mainshaft gear G0, information representing the amount of change in thephase of the main shaft gear G0 corresponding to the number ofrotations, information representing the phase difference between themain shaft gear G0 and the second countershaft gear G2, and informationrepresenting the phase difference between the main shaft gear G0 and thethird countershaft gear G3.

The derivation unit 363 derives the number of rotations of the mainshaft gear G0 as the second number of rotations, using such secondcorrespondence information. Specifically, the derivation unit 363detects the number of rotations of the main shaft gear G0 correspondingto the combination of the second countershaft phase and the thirdcountershaft phase from the second correspondence information stored inadvance in the memory 32 and thus derives this number of rotations asthe second number of rotations.

The derivation unit 363 also derives the number of rotations of the mainshaft gear G0 as the third number of rotations, based on the thirdcountershaft phase, the first countershaft phase, and thirdcorrespondence information stored in advance in the memory 32. The thirdcorrespondence information is information of the correspondence betweenthe combination of the third countershaft phase and the firstcountershaft phase, and the number of rotations of the main shaft gearG0. The configuration of the third correspondence information is similarto the configuration of the first correspondence information andtherefore will not be described further. That is, in the embodiment, thethird correspondence information is a table showing the correspondencebetween information representing the number of rotations of the mainshaft gear G0, information representing the amount of change in thephase of the main shaft gear G0 corresponding to the number ofrotations, information representing the phase difference between themain shaft gear G0 and the third countershaft gear G3, and informationrepresenting the phase difference between the main shaft gear G0 and thefirst countershaft gear G1.

The derivation unit 363 derives the number of rotations of the mainshaft gear G0 as the third number of rotations, using such thirdcorrespondence information. Specifically, the derivation unit 363detects the number of rotations of the main shaft gear G0 correspondingto the combination of the third countershaft phase and the firstcountershaft phase from the third correspondence information stored inadvance in the memory 32 and thus derives this number of rotations asthe third number of rotations.

After the processing of step S230, the determination unit 365 determineswhether the first abnormality condition is satisfied or not (step S240).The first abnormality condition in the embodiment is that two or more ofthe first number of rotations, the second number of rotations, and thethird number of rotations do not coincide with each other. That is, thedetermination unit 365 determines whether the first abnormalitycondition is satisfied or not, based on the first number of rotations,the second number of rotations, and the third number of rotationsderived in step S230.

The first abnormality condition may be that two of the first number ofrotations, the second number of rotations, and the third number ofrotations do not coincide with each other, as described above. In thiscase, the robot control device 30 may be configured not to derive thenumber of rotations that is not selected as the two of the first numberof rotations, the second number of rotations, and the third number ofrotations.

When the determination unit 365 determines that the first abnormalitycondition is not satisfied (NO in step S240), the robot control unit 369ends the processing of step S120, that is, the first processing. Theprocessing to end the first processing in this case may be performed bya functional unit other than the robot control unit 369, of thefunctional units provided in the control unit 36.

Meanwhile, when the determination unit 365 determines that the firstabnormality condition is satisfied (YES in step S240), the robot controlunit 369 stops the first drive unit M1 (step S250). For example, whenstopping the first drive unit M1, the robot control unit 369 causes apower shut-off unit, provided in the robot 20 but not illustrated, toshut off the electricity supply to the first drive unit M1. The powershutoff unit is a member that shuts off the electricity supply to thefirst drive unit M1, and is, for example, a relay switch. As the powershutoff unit, another switching element may be employed instead of therelay switch.

Next, the reporting unit 371 reports information representing that thefirst abnormality condition is satisfied for the first drive unit M1(step S260). The robot control unit 369 then ends the processing of stepS120, that is, the first processing. At this time, the robot controlunit 369 ends the processing without executing the rest of theprocessing of FIG. 5. At this time, the robot control unit 369 may alsoexecute a flow for abnormality occurrence, for example, processing torecord the abnormality.

The foregoing processing of step S230 is an example of each of theeleventh processing, the twelfth processing, and the thirteenthprocessing. The foregoing processing of steps S240 to S250 is an exampleof the fourteenth processing. That is, the robot control device performsthe first processing including the eleventh processing, the twelfthprocessing, and the thirteenth processing. Thus, the robot controldevice 30 can restrain the robot 20 from malfunctioning.

The robot control device 30 calculates three numbers of rotations, thatis, the first number of rotations, the second number of rotations, andthe third number of rotations, as the number of rotations of the mainshaft gear G0, as described above. This means that the robot controldevice 30 monitors that a number of rotations different from the actualnumber of rotations is derived as the number of rotations of the mainshaft gear G0, by two or more systems. That is, the robot control device30 according to the embodiment employs multiple measures of monitoringand thus restrains the robot 20 from malfunctioning due to thederivation of a multiple rotation quantity different from the actualmultiple rotation quantity as the multiple rotation quantity of the mainshaft gear G0 based on the information outputted from the encoder EC. Inthe embodiment, the system means a combination of two countershaft gearsthat can be selected from among the first to third countershaft gears G1to G3 of the encoder EC.

Processing of Step S130

The processing of step S130 in FIG. 5, that is, the third processing,will now be described. FIG. 8 shows an example of the flow of theprocessing of step S130 shown in FIG. 5. The processing in the flowchartshown in FIG. 8 is performed for each of the four drive units M.Therefore, the processing of step S130 will be described, using theprocessing for the first drive unit M1 as an example.

The acquisition unit 361 acquires first main shaft phase informationfrom the main shaft phase output unit S0 of the encoder EC provided inthe first drive unit M1 (step S310). The processing of step S310 issimilar to the processing of step S210 shown in FIG. 6 and thereforewill not be described further. The robot control device 30 may beconfigured to omit the processing of step S310 when using the first mainshaft phase information acquired by the processing of step S120, in theprocessing of step S130.

Next, the acquisition unit 361 acquires first countershaft phaseinformation from the first phase output unit S1 of the encoder ECprovided in the first drive unit M1, acquires second countershaft phaseinformation from the second phase output unit S2 of the encoder EC, andacquires third countershaft phase information from the third phaseoutput unit S3 of the encoder EC (step S320). The processing of stepS320 is similar to the processing of step S220 shown in FIG. 6 andtherefore will not be described further. The robot control device 30 maybe configured to omit the processing of step S320 when using the firstcountershaft phase information, the second countershaft phaseinformation, and the third countershaft phase information acquired bythe processing of step S120, in the processing of step S130.

Next, the derivation unit 363 derives the phase of the main shaft gearG0 as a second main shaft phase, based on the three pieces ofcountershaft phase information acquired in step S320 (step S330). Thethree pieces of countershaft phase information are the firstcountershaft phase information, the second countershaft phaseinformation, and the third countershaft phase information.

The processing of step S330 will now be described.

First, an example of the method by which the derivation unit 363 derivesthe second main shaft phase, based on the first countershaft phaseinformation, the second countershaft phase information, and the thirdcountershaft phase information, will be described.

The teeth of each of the first countershaft gear G1, the secondcountershaft gear G2, and the third countershaft gear G3 mesh with theteeth of the main shaft gear G0. Therefore, the combination of thesecond countershaft phase and the third countershaft phase cancorrespond to the number of rotations of the first countershaft gear G1.Therefore, the derivation unit 363 can derive the number of rotations ofthe first countershaft gear G1, based on the combination of the secondcountershaft phase and the third countershaft phase.

Thus, the derivation unit 363 derives the number of rotations of thefirst countershaft gear G1, based on the second countershaft phase, thethird countershaft phase, and fourth correspondence information storedin advance in the memory 32. The fourth correspondence information isinformation of the correspondence between the combination of the secondcountershaft phase and the third countershaft phase, and the number ofrotations of the first countershaft gear G1. However, in order to derivethe number of rotations of the first countershaft gear G1 as an integer,the derivation unit 363, for example, discards the numbers below thedecimal point of the number of rotations of the first countershaft gearG1 corresponding to the combination of the second countershaft phase andthe third countershaft phase in the fourth correspondence information.For the handling of the numbers below the decimal point of the number ofrotations in the fourth correspondence information, another method suchas rounding off to the nearest integer may be employed.

FIG. 9 shows an example of the fourth correspondence information. In theexample shown in FIG. 9, the fourth correspondence information is atable showing the correspondence between the combination of the secondcountershaft phase and the third countershaft phase, and the number ofrotations of the first countershaft gear G1. This table also shows thecorrespondence between information representing the number of rotationsof the first countershaft gear G1, information representing the phasedifference between the second countershaft gear G2 and the firstcountershaft gear G1, and information representing the phase differencebetween the third countershaft gear G3 and the first countershaft gearG1. The phase difference between the second countershaft gear G2 and thefirst countershaft gear G1 can be used instead of the secondcountershaft phase. Therefore, the table includes the informationrepresenting the phase difference between the second countershaft gearG2 and the first countershaft gear G1, instead of informationrepresenting the second countershaft phase. The phase difference betweenthe third countershaft gear G3 and the first countershaft gear G1 can beused instead of the third countershaft phase. Therefore, the tableincludes the information representing the phase difference between thethird countershaft gear G3 and the first countershaft gear G1, insteadof information representing the third countershaft phase.

In the table shown in FIG. 9, the information representing the phasedifference between the second countershaft gear G2 and the firstcountershaft gear G1 is expressed by the number of teeth of the secondcountershaft gear G2. For example, in the embodiment, the number ofteeth of the second countershaft gear G2 is 19 and the number of teethof the first countershaft gear G1 is 17. Therefore, when the number ofrotations of the first countershaft gear G1 is one, the secondcountershaft phase is smaller than the first countershaft phase by twoteeth of the second countershaft gear G2. That is, the secondcountershaft gear G2 rotates less than the first countershaft gear G1 bytwo teeth of the second countershaft gear G2. In other words, the phasedifference between the second countershaft gear G2 and the firstcountershaft gear G1 is −2 teeth of the second countershaft gear G2.Thus, the table shows that the information representing this phasedifference is “−2 teeth”.

In the table shown in FIG. 9, the information representing the phasedifference between the third countershaft gear G3 and the firstcountershaft gear G1 is expressed by the number of teeth of the thirdcountershaft gear G3. For example, in the embodiment, the number ofteeth of the third countershaft gear G3 is 23 and the number of teeth ofthe first countershaft gear G1 is 17. Therefore, when the number ofrotations of the first countershaft gear G1 is one, the thirdcountershaft phase is smaller than the first countershaft phase by sixteeth of the third countershaft gear G3. That is, the third countershaftgear G3 rotates less than the first countershaft gear G1 by six teeth ofthe third countershaft gear G3. In other words, the phase differencebetween the third countershaft gear G3 and the first countershaft gearG1 is −6 teeth of the third countershaft gear G3. Thus, the table showsthat the information representing this phase difference is “−6 teeth”.

The table shown in FIG. 9 may show other information representing thephase difference between the second countershaft gear G2 and the firstcountershaft gear G1, instead of the phase difference expressed by thenumber of teeth of the second countershaft gear G2. The table may alsoshow other information representing the phase difference between thethird countershaft gear G3 and the first countershaft gear G1, insteadof the phase difference expressed by the number of teeth of the thirdcountershaft gear G3. As the fourth correspondence information, otherinformation representing the correspondence between the combination ofthe second countershaft phase and the third countershaft phase, and thenumber of rotations of the first countershaft gear G1, may be employed,instead of the table.

The derivation unit 363 derives the number of rotations of the firstcountershaft gear G1, using such fourth correspondence information.Specifically, the derivation unit 363 detects the number of rotations ofthe first countershaft gear G1 corresponding to the combination of thesecond countershaft phase and the third countershaft phase from thefourth correspondence information stored in advance in the memory 32 andthus derives this number of rotations.

Based on the derived number of rotations of the first countershaft gearG1 and the first countershaft phase, the derivation unit 363 derives thevalue of the number of rotations of the first countershaft gear G1 addedup with the first countershaft phase, as the multiple rotation quantityof the first countershaft gear G1.

Here, the main shaft gear G0 rotates at an angular velocity that is theangular velocity of the first countershaft gear G1 multiplied by thenumber of teeth of the first countershaft gear G1 divided by the numberof teeth of the main shaft gear G0. Therefore, the value of the multiplerotation quantity of the first countershaft gear G1 multiplied by thenumber of teeth of the first countershaft gear G1 divided by the numberof teeth of the main shaft gear G0 coincides with the multiple rotationquantity of the main shaft gear G0. Also, the main shaft gear G0 makesone rotation as the teeth of the main shaft gear G0 moves by the numberof teeth of the main shaft gear G0 from the starting point. Therefore,the phase of the main shaft gear G0 coincides with the multiple rotationquantity of the main shaft gear G0 mod the number of teeth of the mainshaft gear G0. In other words, the phase of the main shaft gear G0coincides with the number of teeth of the first countershaft gear G1divided by the number of teeth of the main shaft gear G0 mod the numberof teeth of the main shaft gear G0.

Thus, the derivation unit 363 derives the phase of the main shaft gearG0 as the second main shaft phase, based on the derived multiplerotation quantity of the first countershaft gear G1. That is, in stepS330, the derivation unit 363 derives the phase of the main shaft gearG0 as the second main shaft phase, based on the three pieces ofcountershaft phase information acquired in step S320. In such a methodfor deriving the second main shaft phase, the role of the firstcountershaft gear G1 may be replaced by the role of the secondcountershaft gear G2 or may be replaced by the role of the thirdcountershaft gear G3.

FIG. 10 shows an example of such a flow of deriving the second mainshaft phase. As shown in FIG. 10, the second main shaft phase is derivedbased on the multiple rotation quantity of the first countershaft gearG1. The multiple rotation quantity of the first countershaft gear G1 isderived based on the first countershaft phase and the number ofrotations of the first countershaft gear G1. The number of rotations ofthe first countershaft gear G1 is derived based on the secondcountershaft phase and the third countershaft phase.

After the processing of step S330, the determination unit 365 determineswhether the third abnormality condition is satisfied or not (step S340).The third abnormality condition is that the first main shaft phase andthe second main shaft phase do not coincide with each other, asdescribed above. That is, the determination unit 365 determines whetherthe third abnormality condition is satisfied or not, based on the secondmain shaft phase derived in step S330.

When the determination unit 365 determines that the third abnormalitycondition is not satisfied (NO in step S340), the robot control unit 369ends the processing of step S130, that is, the third processing. Theprocessing to end the third processing in this case may be performed bya functional unit other than the robot control unit 369, of thefunctional units provided in the control unit 36.

Meanwhile, when the determination unit 365 determines that the thirdabnormality condition is satisfied (YES in step S340), the robot controlunit 369 stops the first drive unit M1 (step S350). The processing ofstep S350 is similar to the processing of step S250 shown in FIG. 6 andtherefore will not be described further.

Next, the reporting unit 371 reports information representing that thethird abnormality condition is satisfied for the first drive unit M1(step S360). The robot control unit 369 then ends the processing of stepS130, that is, the third processing. At this time, the robot controlunit 369 ends the processing without executing the rest of theprocessing of FIG. 5. At this time, the robot control unit 369 may alsoexecute a flow for abnormality occurrence, for example, processing torecord the abnormality.

The foregoing processing of step S330 is an example of the thirty-firstprocessing. The foregoing processing of steps S340 to S350 is an exampleof the thirty-second processing. That is, the robot control device 30performs the third processing including the thirty-first processing andthe thirty-second processing. Thus, the robot control device 30 canrestrain the robot 20 from malfunctioning.

The robot control device 30 derives the second main shaft phase based onthe derived multiple rotation quantity of the first countershaft gearG1, separately from the first main shaft phase specified by the mainshaft phase output unit S0, as the phase of the main shaft gear G0, asdescribed above. This means that the robot control device 30 monitorsthat a phase different from the actual phase is derived as the phase ofthe main shaft gear G0, by the combination of the main shaft gear G0 andthe first countershaft gear G1. That is, the robot control device 30according to the embodiment performs monitoring based on thiscombination and thus restrains the robot 20 from malfunctioning due tothe derivation of a multiple rotation quantity different from the actualmultiple rotation quantity as the multiple rotation quantity of the mainshaft gear G0 based on the information outputted from the encoder EC.

The robot control device 30 may be configured to monitor that a phasedifferent from the actual phase is derived as the phase of the mainshaft gear G0, by each of the combination of the main shaft gear G0 andthe first countershaft gear G1, the combination of the main shaft gearG0 and the second countershaft gear G2, and the combination of the mainshaft gear G0 and the third countershaft gear G3. That is, the robotcontrol device 30 may be configured to monitor that a phase differentfrom the actual phase is derived as the phase of the main shaft gear G0,by the combination of the main shaft gear G0 and the second countershaftgear G2, and to monitor that a phase different from the actual phase isderived as the phase of the main shaft gear G0, by the combination ofthe main shaft gear G0 and the third countershaft gear G3, based onprocessing similar to the processing in the flowchart shown in FIG. 8.

Processing of Step S170

The processing of step S170 in FIG. 5, that is, the second processing,will now be described. FIG. 11 shows an example of the flow of theprocessing of step S170 shown in FIG. 5. The processing in the flowchartshown in FIG. 11 is performed for each of the four drive units M. Also,the processing in the flowchart shown in FIG. 11 is performed for eachof the first to third countershaft gears G1 to G3 of the encoder EC inone drive unit M. Therefore, the processing of step S170 will bedescribed, using the processing for the first countershaft gear G1 ofthe first drive unit M1 as an example.

The acquisition unit 361 stores the first main shaft phase informationacquired immediately before by the acquisition unit 361, as old firstmain shaft phase information, into the memory 32. The acquisition unit361 then acquires first main shaft phase information that is new, as newfirst main shaft phase information, from the main shaft phase outputunit S0 of the encoder EC provided in the first drive unit M1 (stepS410). When old first main shaft phase information is already stored inthe memory 32, the acquisition unit 361 replaces the old first mainshaft phase information stored in the memory 32 with old first mainshaft phase information that is new.

Next, the acquisition unit 361 stores the first countershaft phaseinformation acquired immediately before by the acquisition unit 361, asold first countershaft phase information, into the memory 32. Theacquisition unit 361 then acquires first countershaft phase informationthat is new, as new first countershaft phase information, from the firstphase output unit S1 of the encoder EC provided in the first drive unitM1 (step S420). When old first countershaft phase information is alreadystored in the memory 32, the acquisition unit 361 replaces the old firstcountershaft phase information stored in the memory 32 with old firstcountershaft phase information that is new.

Next, the derivation unit 363 derives an eleventh amount of change (stepS430). The eleventh amount of change is the amount of change in thefirst countershaft phase derived based on the first main shaft phase.

The processing of step S430 will now be described. First, a method forderiving the eleventh amount of change will be described. When one gearg1 and another gear g2 mesh with each other, the following equation (1)holds:Δθ2=(h1/h2)×Δθ1  (1).

In the equation (1), Δθ1 is the amount of change in the phase of thegear g1, Δθ2 is the amount of change in the phase of the gear g2, h1 isthe number of teeth of the gear g1, and h2 is the number of teeth of thegear g2.

The derivation unit 363 can derive the amount of change in the firstcountershaft phase from the equation (1), by substituting the amount ofchange in the first main shaft phase for Δθ1, substituting the number ofteeth of the main shaft gear G0 for h1, and substituting the number ofteeth of the first countershaft gear G1 for h2. FIG. 12 shows an exampleof the relation between the main shaft gear G0, the first countershaftgear G1, Δθ1, and Δθ2. For example, when the amount of change in thefirst main shaft phase is 360 degrees in the embodiment, the derivationunit 363 derives approximately 423 degrees as the amount of change inthe first countershaft phase, based on the equation (1). By such amethod, the derivation unit 363 derives the amount of change in thefirst countershaft phase as the eleventh amount of change.

Next, the processing in which the derivation unit 363 derives the amountof change in the first main shaft phase will be described. Thederivation unit 363 reads out, from the memory 32, the old first mainshaft phase information stored in the memory 32. The derivation unit 363derives the value of the first main shaft phase represented by the newfirst main shaft phase information acquired by the acquisition unit 361in step S410 minus the first main shaft phase represented by the oldfirst main shaft phase information thus read out, as the amount ofchange in the first main shaft phase. The derivation unit 363substitutes the amount of change in the first main shaft phase thusderived, for Δθ1 in the above equation, and thus derives the eleventhamount of change.

The eleventh amount of change derived by the derivation unit 363 whenperforming the processing of step S430 for the second countershaft gearG2 is an example of a twenty-first amount of change. The eleventh amountof change derived by the derivation unit 363 when performing theprocessing of step S430 for the third countershaft gear G3 is an exampleof a thirty-first amount of change.

After the processing of step S430, the derivation unit 363 derives atwelfth amount of change (step S440). The twelfth amount of change isthe amount of change in the first countershaft phase derived based onthe first countershaft phase. Specifically, the derivation unit 363reads out, from the memory 32, the old first countershaft phaseinformation stored in the memory 32. The derivation unit 363 the valueof the first countershaft phase represented by the new firstcountershaft phase information the acquired by the acquisition unit 361in step S420 minus the first countershaft phase represented by the oldfirst countershaft phase information thus read out, as the twelfthamount of change. That is, this value is the amount of change in thefirst countershaft phase derived based on the first countershaft phase.

The twelfth amount of change derived by the derivation unit 363 whenperforming the processing of step S440 for the second countershaft gearG2 is an example of a twenty-second amount of change. The twelfth amountof change derived by the derivation unit 363 when performing theprocessing of step S440 for the third countershaft gear G3 is an exampleof a thirty-second amount of change.

Next, the determination unit 365 determines whether a second abnormalitycondition is satisfied or not (step S450). The second abnormalitycondition is that the eleventh amount of change and the twelfth amountof change do not coincide with each other. That is, the determinationunit 365 determines whether the second abnormality condition issatisfied or not, based on the eleventh amount of change derived in stepS430 and the twelfth amount of change derived in step S440.

When the determination unit 365 determines that the second abnormalitycondition is not satisfied (NO in step S450), the robot control unit 369ends the processing of step S170, that is, the second processing. Theprocessing to end the second processing in this case may be performed bya functional unit other than the robot control unit 369, of thefunctional units provided in the control unit 36.

Meanwhile, when the determination unit 365 determines that the secondabnormality condition is satisfied (YES in step S450), the robot controlunit 369 stops the first drive unit M1 (step S460). The processing ofstep S460 is similar to the processing of step S250 shown in FIG. 6 andtherefore will not be described further.

Next, the reporting unit 371 reports information representing that thesecond abnormality condition is satisfied for the first drive unit M1(step S470). The robot control unit 369 then ends the processing of stepS170, that is, the second processing. At this time, the robot controlunit 369 ends the processing without executing the rest of theprocessing of FIG. 5. At this time, the robot control unit 369 may alsoexecute a flow for abnormality occurrence, for example, processing torecord the abnormality.

In this way, processing using a table is not performed in the secondprocessing. Therefore, in the second processing, the load of theprocessing performed by the derivation unit 363 is lower than in each ofthe first processing and the third processing. That is, since the robotcontrol device 30 performs the second processing after performing thefirst round of the first processing and the third processing, the loadof the processing performed by the robot control device 30 during theoperation of the robot 20 can be made lower than when performing thefirst processing and the third processing.

The control unit 36 may be configured to be able to change one or bothof the first predetermined time and the second predetermined timedescribed above, according to an operation accepted by the robot controldevice 30 from the user or an operation of the robot 20 or the like.

The second processing performed for the encoder EC of one drive unit Mmay be performed for a part of the first to third countershaft gears G1to G3, instead of being performed for each of the first to thirdcountershaft gears G1 to G3 of the drive unit M. However, in this case,when an abnormality occurs about a countershaft gear that is notincluded in the part of the countershaft gears, the second processingcannot stop the drive unit M, and the information representing that thesecond abnormality condition is satisfied cannot be reported, either.Therefore, it is desirable that the second processing is performed foreach of the first to third countershaft gears G1 to G3 of the drive unitM.

The relationship expressed by the equation (1) also holds when the gearg1 and the gear g2 mesh with each other via another gear g3. Forexample, the first countershaft gear G1 and the second countershaft gearG2 mesh with each other via the main shaft gear G0. Therefore, theamount of change in the first countershaft phase and the amount ofchange in the second countershaft phase satisfy the equation (1). Also,for example, the second countershaft gear G2 and the third countershaftgear G3 mesh with each other via the main shaft gear G0. Therefore, theamount of change in the second countershaft phase and the amount ofchange in the third countershaft phase satisfy the equation (1). Also,for example, the third countershaft gear G3 and the first countershaftgear G1 mesh with each other via the main shaft gear G0. Therefore, theamount of change in the third countershaft phase and the amount ofchange in the first countershaft phase satisfy the equation (1).

Due to such circumstances, the second processing may include processingto derive a forty-first amount of change, processing to derive aforty-second amount of change, processing to determine whether a fifthabnormality condition is satisfied or not, processing to stop the driveunit M when the fifth abnormality condition is satisfied, and processingto report that the fifth abnormality condition is satisfied in thatcase. The forty-first amount of change is the amount of change in thefirst countershaft phase derived based on the second countershaft phase.The forty-second amount of change is the amount of change in the firstcountershaft phase derived based on the first countershaft phase. Thefifth abnormality condition is that the forty-first amount of change andthe forty-second amount of change do not coincide with each other. Themethod for deriving the forty-first amount of change is similar to themethod for deriving the eleventh amount of change with the main shaftgear G0 replaced by the second countershaft gear G2 and therefore willnot be described further.

The second processing may also include processing to derive afifty-first amount of change, processing to derive a fifty-second amountof change, processing to determine whether a sixth abnormality conditionis satisfied or not, processing to stop the drive unit M when the sixthabnormality condition is satisfied, and processing to report that thesixth abnormality condition is satisfied in that case. The fifty-firstamount of change is the amount of change in the second countershaftphase derived based on the third countershaft phase. The fifty-secondamount of change is the amount of change in the second countershaftphase derived based on the second countershaft phase. The sixthabnormality condition is that the fifty-first amount of change and thefifty-second amount of change do not coincide with each other. Themethod for deriving the fifty-first amount of change is similar to themethod for deriving the eleventh amount of change with the main shaftgear G0 replaced by the third countershaft gear G3 and with the firstcountershaft gear G1 replaced by the second countershaft gear G2 andtherefore will not be described further.

The second processing may also include processing to derive asixty-first amount of change, processing to derive a sixty-second amountof change, processing to determine whether a seventh abnormalitycondition is satisfied or not, processing to stop the drive unit M whenthe seventh abnormality condition is satisfied, and processing to reportthat the seventh abnormality condition is satisfied in that case. Thesixty-first amount of change is the amount of change in the thirdcountershaft phase derived based on the first countershaft phase. Thesixty-second amount of change is the amount of change in the thirdcountershaft phase derived based on the third countershaft phase. Theseventh abnormality condition is that the sixty-first amount of changeand the sixty-second amount of change do not coincide with each other.The method for deriving the sixty-first amount of change is similar tothe method for deriving the eleventh amount of change with the mainshaft gear G0 replaced by the first countershaft gear G1 and with thefirst countershaft gear G1 replaced by the third countershaft gear G3and therefore will not be described further.

Modification Examples of Embodiment

Modification examples of the embodiment will now be described.

The encoder EC may have one or more countershaft gears in addition tothe main shaft gear G0, the first countershaft gear G1, the secondcountershaft gear G2, and the third countershaft gear G3. In this case,the one or more countershaft gears are provided in the encoder EC insuch a way as to mesh with the main shaft gear G0 and not to mesh witheach of the first to third countershaft gears G1 to G3.

For example, the encoder EC may have a fourth countershaft gear G4, notillustrated, in addition to the main shaft gear G0, the firstcountershaft gear G1, the second countershaft gear G2, and the thirdcountershaft gear G3. In this case, in the encoder EC, the number ofcombinations of two countershaft gears that can be selected from amongthe four countershaft gears is six. In this case, in the encoder EC, thenumber of combinations of three countershaft gears that can be selectedfrom among the four countershaft gears is four. On the assumption thateach of these ten combinations is referred to as a system, the number ofrotations of the main shaft gear G0 can be derived for each system by amethod similar to the method for deriving each of the first to thirdnumbers of rotations in the first processing. In such a case, thecontrol unit 36 determines whether two or more of the numbers ofrotations for the respective systems do not coincide with each other,based on the number of rotations for each system. Thus, the robotcontrol device 30 can perform processing similar to the first processingand can restrain the robot 20 from malfunctioning.

The control unit 36 may be configured to specify a number of rotationsthat coincides with a majority of the numbers of the respective systems,based on the number of rotations for each system. In this case, thecontrol unit 36 can specify a countershaft gear about which anabnormality has occurred, of the first to fourth countershaft gears G1to G4. Thus, the control unit 36 can determine whether the operation ofthe robot 20 needs to be continued or not, and can restrain the robot 20from malfunctioning.

The number of teeth of the fourth countershaft gear G4 may be the sameas the number of teeth of the main shaft gear G0 or may be the same asthe number of teeth of one of the first to third countershaft gears G1to G3.

The main shaft phase output unit S0 may be a functional unit whichderives a phase of the main shaft gear G0 based on a mathematical modeland estimates the derived phase as the first main shaft phase, of thefunctional units provided in the control unit 36, instead of the sensordetecting the first main shaft phase. In this case, the encoder EC maybe configured with the sensor or may be configured without the sensor.The mathematical model is a model based on an equation of motiondescribing a rotating motion between the rotary shaft of the drive unitM and a load attached to the rotary shaft. The mathematic model is amodel which estimates a phase of the rotary shaft and outputs theestimated phase, when a command current to rotate the rotary shaft isinputted to the drive unit M. The mathematical model may include a modelto derive the load or may not include a model to derive the load. Themathematical model may be a model based on another derivation methodsuch as a model using a table, instead of the model based on theequation of motion.

When the main shaft phase output unit S0 is such a mathematical model,the control unit 36 performs the first processing, based on the firstmain shaft phase outputted from the main shaft phase output unit S0.That is, even in this case, the robot control device 30 can restrain therobot 20 from malfunctioning by the first processing. The mathematicalmodel may use, as an input, information that can specify the phase ofthe main shaft gear G0 acquired from another sensor detecting thisinformation, instead of using the command current as an input.

A part or all of the first to seventh abnormality conditions may or maynot allow a margin of error.

As described above, the function of performing the processing in theflowchart shown in FIG. 5, of the functions provided in the control unit36, may be provided in the robot 20, the information processing device40, the encoder EC or the like. For example, when this function isprovided in the information processing device 40, the informationprocessing device 40 has, for example, a processor, and a control unit41 provided in the information processing device 40 has the acquisitionunit 361, the derivation unit 363, the determination unit 365, the timemeasuring unit 367, and the reporting unit 371, as shown in FIG. 13.FIG. 13 shows an example of the functional configuration of the controlunit 41. Also, the control unit 41 provided in the informationprocessing device 40 may have the acquisition unit 361, the derivationunit 363, and the determination unit 365, without having the timemeasuring unit 367 and the reporting unit 371. Meanwhile, for example,when this function is provided in the encoder EC, the encoder EC has,for example, a processor, and a control unit provided in the encoder EChas the acquisition unit 361, the derivation unit 363, the determinationunit 365, the time measuring unit 367, and the reporting unit 371. Also,the control unit provided in the encoder EC may have the acquisitionunit 361, the derivation unit 363, and the determination unit 365,without having the time measuring unit 367 and the reporting unit 371.By these measures, this function can be executed simply by using theinformation processing device 40 or the encoder EC having this function,even when the robot control device 30 or the like does not have thisfunction. Moreover, this function may be split among the robot 20, therobot control device 30, the information processing device 40, theencoder EC and the like. For example, when this function is provided inthe encoder EC and the robot control device 30, the encoder EC may havethe acquisition unit 361 and the derivation unit 363, and the robotcontrol device 30 may have the determination unit 365, the timemeasuring unit 367, and the reporting unit 371.

The robot control device 30 may be provided for a robot that isdifferent from the robot 20, as described above. For example, the robotcontrol device 30 may be provided in a robot 21 shown in FIG. 14. FIG.14 shows an example of the configuration of the robot system 1 havingthe robot 21 instead of the robot 20.

In the example shown in FIG. 14, the robot 21 has the robot controldevice 30 and the information processing device 40 built inside.

The robot 21 is the above-described dual-arm robot. As shown in FIG. 14,the robot 21 has two arms.

Each of the two arms of the robot 21 is provided with seven joints. Eachof the seven joints is provided with the drive unit M. In FIG. 14, thedrive unit M is omitted in order to simplify the illustration. One orboth of the two arms may be provided fewer than seven joints or may beprovided with more than seven joints.

Thus, the robot control device 30, even when built in the robot 21, canperform at least one of the first processing and the third processingand thus can restrain the robot from malfunctioning.

As described above, the robot system according to the embodimentincludes: a robot having a main shaft gear attached to a rotary shaft ofa drive unit, a first countershaft gear meshing with the main shaftgear, a second countershaft gear meshing with the main shaft gear, and athird countershaft gear meshing with the main shaft gear; and a mainshaft phase output unit outputting a phase of the main shaft gear as afirst main shaft phase. The robot system derives the phase of the mainshaft gear as a second main shaft phase, based on a phase of the firstcountershaft gear, a phase of the second countershaft gear, and a phaseof the third countershaft gear, and performs processing to stop thedrive unit when the first main shaft phase and the second main shaftphase do not coincide with each other. Thus, the robot system candetermine whether a number of rotations different from the actual numberof rotations is derived or not, and can restrain the robot frommalfunctioning. In the foregoing example, the robot system is the robotsystem 1. In the foregoing example, the drive unit is the drive unit M.In the foregoing example, the main shaft gear is the main shaft gear G0.In the foregoing example, the first countershaft gear is the firstcountershaft gear G1. In the foregoing example, the second countershaftgear is the second countershaft gear G2. In the foregoing example, thethird countershaft gear is the first countershaft gear G3. In theforegoing example, the robot is the robot 20. In the foregoing example,the main shaft phase output unit is the main shaft phase output unit S0.

The robot system may perform the processing during the period until therobot starts moving after the power supply of the robot is turned on.

The robot system may have a first phase output unit outputting the phaseof the first countershaft gear. The robot system may derive an amount ofchange in the phase of the first countershaft gear as an eleventh amountof change, based on the first main shaft phase outputted from the mainshaft phase output unit, derive an amount of change in the phase of thefirst countershaft gear outputted from the first phase output unit as atwelfth amount of change, and stop the drive unit when the eleventhamount of change and the twelfth amount of change do not coincide witheach other, as second processing. The robot system may perform thesecond processing after the first round of the processing is performed.In the foregoing example, the first phase output unit is the first phaseoutput unit S1.

The robot system may also have a second phase output unit outputting thephase of the second countershaft gear, and a third phase output unitoutputting the phase of the third countershaft gear. The secondprocessing may further include deriving an amount of change in the phaseof the second countershaft gear as a twenty-first amount of change,based on the first main shaft phase outputted from the main shaft phaseoutput unit, deriving an amount of change in the phase of the thirdcountershaft gear as a thirty-first amount of change, based on the firstmain shaft phase outputted from the main shaft phase output unit,deriving an amount of change in the phase of the second countershaftgear outputted from the second phase output unit as a twenty-secondamount of change, deriving an amount of change in the phase of the thirdcountershaft gear outputted from the third phase output unit as athirty-second amount of change, stopping the drive unit when thetwenty-first amount of change and the twenty-second amount of change donot coincide with each other, and stopping the drive unit when thethirty-first amount of change and the thirty-second amount of change donot coincide with each other. In the foregoing example, the second phaseoutput unit is the second phase output unit S2. In the foregoingexample, the third phase output unit is the third phase output unit S3.

In the robot system, the main shaft phase output unit may output thefirst main shaft phase based on a mathematical model.

The robot system may determine whether a predetermined condition issatisfied after the first round of the processing is performed, and therobot system may perform the processing when the predetermined conditionis satisfied. In the foregoing example, the predetermined condition isthat the first predetermined time passes.

In the robot system, the predetermined condition may be that apredetermined time passes. In the foregoing example, the predeterminedtime is the first predetermined time.

In the robot system, the robot may further include a fourth countershaftgear. In the foregoing example, the fourth countershaft gear is thefourth countershaft gear G4.

In the robot system, the robot may have a power shutoff unit shuttingoff electricity supply to the robot. The power shutoff unit may shut offthe electricity supply to the robot when stopping the drive unit.

In the robot system, the processing may further include reportinginformation representing that the first main shaft phase and the secondmain shaft phase do not coincide with each other when the first mainshaft phase and the second main shaft phase do not coincide with eachother.

Also, the robot system according to the embodiment is a robot systemincluding: a robot having a main shaft gear attached to a rotary shaftof a drive unit, a first countershaft gear meshing with the main shaftgear, a second countershaft gear meshing with the main shaft gear, and athird countershaft gear meshing with the main shaft gear. A number ofteeth of the main shaft gear, a number of teeth of the firstcountershaft gear, a number of teeth of the second countershaft gear,and a number of teeth of the third countershaft gear are integers havingno greatest common divisor other than 1. As first processing, a firstnumber of rotations, which is a number of rotations of the main shaftgear, is derived based on a phase of the first countershaft gear and aphase of the second countershaft gear, and a second number of rotations,which is a number of rotations of the main shaft gear, is derived basedon the phase of the second countershaft gear and a phase of the thirdcountershaft gear, and the drive unit is stopped when the first numberof rotations and the second number of rotations do not coincide witheach other. Thus, the robot system can determine whether a phasedifferent from the actual phase is detected or not, and can restrain therobot from malfunctioning. In the foregoing example, the robot system isthe robot system 1. In the foregoing example, the drive unit is thedrive unit M. In the foregoing example, the main shaft gear is the mainshaft gear G0. In the foregoing example, the first countershaft gear isthe first countershaft gear G1. In the foregoing example, the secondcountershaft gear is the second countershaft gear G2. In the foregoingexample, the third countershaft gear is the first countershaft gear G3.In the foregoing example, the robot is the robot 20.

In the robot system, the first processing may include deriving a thirdnumber of rotations, which is a number of rotations of the main shaftgear, based on the phase of the third countershaft gear and the phase ofthe first countershaft gear, and stopping the drive unit when the firstnumber of rotations, the second number of rotations, and the thirdnumber of rotations do not coincide with each other.

In the robot system, the first processing may further include reportinginformation representing that the first number of rotations, the secondnumber of rotations, and the third number of rotations do not coincidewith each other when the first number of rotations, the second number ofrotations, and the third number of rotations do not coincide with eachother.

The robot system may perform the first processing during the perioduntil the robot starts moving after the power supply of the robot isturned on.

The robot system may have a main shaft phase output unit outputting thephase of the main shaft gear as a first main shaft phase, and a firstphase output unit outputting the phase of the first countershaft gear.The robot system may derive an amount of change in the phase of thefirst countershaft gear as an eleventh amount of change, based on thefirst main shaft phase outputted from the main shaft phase output unit,derive an amount of change in the phase of the first countershaft gearoutputted from the first phase output unit as a twelfth amount ofchange, and stop the drive unit when the eleventh amount of change andthe twelfth amount of change do not coincide with each other, as secondprocessing. The robot system may perform the second processing after thefirst round of the first processing is performed. In the foregoingexample, the main shaft phase output unit is the main shaft phase outputunit S0. In the foregoing example, the first phase output unit is thefirst phase output unit S1.

The robot system may also have a second phase output unit outputting thephase of the second countershaft gear, and a third phase output unitoutputting the phase of the third countershaft gear. The secondprocessing may further include deriving an amount of change in the phaseof the second countershaft gear as a twenty-first amount of change,based on the first main shaft phase outputted from the main shaft phaseoutput unit, deriving an amount of change in the phase of the thirdcountershaft gear as a thirty-first amount of change, based on the firstmain shaft phase outputted from the main shaft phase output unit,deriving an amount of change in the phase of the second countershaftgear outputted from the second phase output unit as a twenty-secondamount of change, deriving an amount of change in the phase of the thirdcountershaft gear outputted from the third phase output unit as athirty-second amount of change, stopping the drive unit when thetwenty-first amount of change and the twenty-second amount of change donot coincide with each other, and stopping the drive unit when thethirty-first amount of change and the thirty-second amount of change donot coincide with each other. In the foregoing example, the second phaseoutput unit is the second phase output unit S2. In the foregoingexample, the third phase output unit is the third phase output unit S3.

In the robot system, the main shaft phase output unit may output thefirst main shaft phase based on a mathematical model.

The robot system may determine whether a predetermined condition issatisfied after the first round of the first processing is performed,and the robot system may perform the first processing when thepredetermined condition is satisfied. In the foregoing example, thepredetermined condition is that the first predetermined time passes.

In the robot system, the predetermined condition may be that apredetermined time passes. In the foregoing example, the predeterminedtime is the first predetermined time.

In the robot system, the robot may further include a fourth countershaftgear. In the foregoing example, the fourth countershaft gear is thefourth countershaft gear G4.

In the robot system, the robot may have a power shutoff unit shuttingoff electricity supply to the robot. The power shutoff unit may shut offthe electricity supply to the robot when stopping the drive unit.

The embodiment of the present disclosure has been described in detailwith reference to the drawings. However, the present disclosure is notlimited to the specific configuration of the embodiment. Any change,replacement, deletion or the like can be made without departing from thespirit and scope of the present disclosure.

A program for implementing a function of an arbitrary component of theforegoing device may be recorded in a computer-readable recordingmedium, and the program may be read and executed by a computer system.The device is, for example, the robot 20, the robot 21, the robotcontrol device 30, the information processing device 40, the encode ECor the like. The “computer system” in this case includes an OS(operating system) and hardware such as a peripheral device. The“computer-readable recording medium” is a portable medium such as aflexible disk, magneto-optical disk, ROM, or CD (compact disk)-ROM, or astorage device such as a hard disk built in the computer system. The“computer-readable recording medium” also includes a recording mediumholding a program for a predetermined time, such as a volatile memoryinside a computer system serving as a server or client when the programis transmitted via a network such as the internet or via a communicationline such as a telephone line.

The program may be transmitted from a computer system having thisprogram stored in a storage device or the like to another computersystem via a transmission medium or via a transmission wave in thetransmission medium. The “transmission medium” transmitting the programis a medium having the function of transmitting information, such as anetwork like the internet or a communication line like a telephone line.

The program may be for implementing a part of the foregoing function.Also, the program may be a program that can implement the foregoingfunction when combined with a program already recorded in the computersystem, that is, a so-called a differential file or differentialprogram.

What is claimed is:
 1. A robot system comprising: a robot having a mainshaft gear attached to a rotary shaft of a drive unit, a firstcountershaft gear meshing with the main shaft gear, a secondcountershaft gear meshing with the main shaft gear, and a thirdcountershaft gear meshing with the main shaft gear; and a main shaftphase output unit outputting a phase of the main shaft gear as a firstmain shaft phase, wherein a phase of the main shaft gear is derived as asecond main shaft phase, based on a phase of the first countershaftgear, a phase of the second countershaft gear, and a phase of the thirdcountershaft gear, and processing to stop the drive unit is performedwhen the first main shaft phase and the second main shaft phase do notcoincide with each other.
 2. The robot system according to claim 1,wherein the processing is performed during a period until the robotstarts moving after a power supply of the robot is turned on.
 3. Therobot system according to claim 1, further comprising a first phaseoutput unit outputting the phase of the first countershaft gear, whereinas second processing, an amount of change in the phase of the firstcountershaft gear is derived as an eleventh amount of change, based onthe first main shaft phase outputted from the main shaft phase outputunit, an amount of change in the phase of the first countershaft gearoutputted from the first phase output unit is derived as a twelfthamount of change, and the drive unit is stopped when the eleventh amountof change and the twelfth amount of change do not coincide with eachother, and the second processing is performed after a first round of theprocessing is performed.
 4. The robot system according to claim 3,further comprising: a second phase output unit outputting the phase ofthe second countershaft gear; and a third phase output unit outputtingthe phase of the third countershaft gear, wherein the second processingfurther includes deriving an amount of change in the phase of the secondcountershaft gear as a twenty-first amount of change, based on the firstmain shaft phase outputted from the main shaft phase output unit,deriving an amount of change in the phase of the third countershaft gearas a thirty-first amount of change, based on the first main shaft phaseoutputted from the main shaft phase output unit, deriving an amount ofchange in the phase of the second countershaft gear outputted from thesecond phase output unit, as a twenty-second amount of change, derivingan amount of change in the phase of the third countershaft gearoutputted from the third phase output unit, as a thirty-second amount ofchange, stopping the drive unit when the twenty-first amount of changeand the twenty-second amount of change do not coincide with each other,and stopping the drive unit when the thirty-first amount of change andthe thirty-second amount of change do not coincide with each other. 5.The robot system according to claim 3, wherein the main shaft phaseoutput unit outputs the first main shaft phase, based on a mathematicalmodel.
 6. The robot system according to claim 1, wherein whether apredetermined condition is satisfied is determined after a first roundof the first processing is performed, and the first processing isperformed when the predetermined condition is satisfied.
 7. The robotsystem according to claim 6, wherein the predetermined condition is thata predetermined passes.
 8. The robot system according to claim 1,wherein the robot further includes a fourth countershaft gear.
 9. Therobot system according to claim 1, wherein the robot has a power shutoffunit shutting off electricity supply to the robot, and the power shutoffunit shuts off the electricity supply to the robot when stopping thedrive unit.
 10. The robot system according to claim 1, wherein theprocessing further includes reporting information representing that thefirst main shaft phase and the second main shaft phase do not coincidewith each other when the first main shaft phase and the second mainshaft phase do not coincide with each other.
 11. A robot control methodfor controlling a robot having a main shaft gear attached to a rotaryshaft of a drive unit, a first countershaft gear meshing with the mainshaft gear, a second countershaft gear meshing with the main shaft gear,and a third countershaft gear meshing with the main shaft gear, themethod comprising: outputting a phase of the main shaft gear as a firstmain shaft phase; deriving a phase of the main shaft gear as a secondmain shaft phase, based on a phase of the first countershaft gear, aphase of the second countershaft gear, and a phase of the thirdcountershaft gear; and performing processing to stop the drive unit whenthe first main shaft phase and the second main shaft phase do notcoincide with each other.
 12. A robot system comprising: an encoderhaving a main shaft gear, a first countershaft gear, a secondcountershaft gear, and a third countershaft gear; a robot having theencoder; a control unit; and a main shaft phase output unit outputting aphase of the main shaft gear as a first main shaft phase, wherein thecontrol unit is configured to execute a command to perform thirdprocessing, and the third processing includes processing to derive aphase of the main shaft gear as a second main shaft phase, based on aphase of the first countershaft gear, a phase of the second countershaftgear, and a phase of the third countershaft gear, and processing to stopthe robot when the first main shaft phase and the second main shaftphase do not coincide with each other.